Ext.regController('Home', {
 
    // index action()
	// just an introductory page
    index: function()
    {
    	
    	//sets the title in the title bar
    	setTitle(this,"Welcome"); 
	    	
	    //creates a local variable that contains the view	
    	 if ( ! this.indexView)
    	    {
    	        this.indexView = this.render({
    	            xtype: 'HomeIndex',
    	        });
    	    }
    	 //back button is hidden
    	var backBtn = this.application.viewport.query('#backBtn')[0];
  	      backBtn.hide();
  	      
  	      //next button is show to give functionality for next page
  	      
  	    var nextBtn = this.application.viewport.query('#nextBtn')[0];
		nextBtn.show();
		//se face leg dintre butonul next si umratorul view
		nextBtn.setHandler(function()
				{
				    Ext.dispatch({
				        controller: 'Map',
				        action: 'position',
				        historyUrl: 'Map/position', 
				        //
				        animation: {
				            type: 'slide', 
				        },
				    });
				}); 
		
		//se seteaza urmatorul view ca fiind activ folosind variabila locala
  	    this.application.viewport.setActiveItem(this.indexView );
   },
});